package com.jiyang.jyandroid.test02;

import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AlertDialog;
import android.widget.Toast;

import com.jiyang.jyandroid.BaseActivity;

/**
 * Created by jy on 2016/10/24.
 * 显示提示消息对话框
 */

public class Two_3Activity extends BaseActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        AlertDialog alertDialog;
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle("消息提示");
        builder.setMessage("这是一条重要提醒，请注意!!");
        builder.setPositiveButton("我知道了", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
                finish();
            }
        });
        builder.setNegativeButton("我不管", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                Toast.makeText(Two_3Activity.this, "你忽略了这条主要信息", Toast.LENGTH_SHORT).show();
                dialog.dismiss();
                finish();
            }
        });
        alertDialog = builder.create();
        alertDialog.show();
    }
}
